﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif 

// **********************************************************************
// Copyright (C) XM
// Author: 赵思佳
// Date: 2019-01-17
// Desc: 
// **********************************************************************
namespace SpaceDFramework
{
    public class MathUtil
    {
        /// <summary>
        /// 从数组中随机获取一个元素
        /// </summary>
        /// <typeparam name="T">泛型参数</typeparam>
        /// <param name="array">可以任意个数的参数，也可以是参数数组</param>
        /// <returns>返回泛型的元素</returns>
        public T GetRandomValueFrom<T>(params T[] array)
        {
            T value = array[UnityEngine.Random.Range(0, array.Length - 1)];
            return value;
        }
    }
}
